<?php
/**
 * Represents a <tr> control.
 */
fily_XMLConverter::registerNamespace('row', fily_Row);
class fily_Row extends fily_ControlContainer {
    /**
     *
     */
    public function __construct() {
        parent::__construct('tr');
    }

    /**
     * adds a cell to the row
     * @param fily_ControlToHtml $innerControl
     * @return fily_Cell
     */
    public function addCell(fily_ControlToHtml $innerControl = null) {
        $cell = new fily_Cell();
        if($innerControl!=null)
            $cell->controls->add($innerControl);
        $this->controls->add($cell);
        return $cell;
    }

    /**
     * adds a header cell to the row
     * @param fily_ControlToHtml $innerControl
     * @return fily_Cell
     */
    public function addHeaderCell(fily_ControlToHtml $innerControl = null) {
        $headerCell = new fily_HeaderCell();
        if($innerControl!=null)
            $headerCell->controls->add($innerControl);
        $this->controls->add($headerCell);
        return $headerCell;
    }

    /**
     * adds a text cell
     * @param string $text
     * @return fily_Cell
     */
    public function addTextCell($text) {
        return $this->addCell(new fily_Text($text));
    }

  



}
?>
